package cn.doitedu;

// 修饰符 class  类名
public class StudentInfo {

    // 成员变量
    double chineseScore;  // 150分
    double mathScore;  // 100分
    double chemicalScore;  // 150分
    double musicScore;  // 100分

    public StudentInfo() {
        this.chineseScore = 88.8;

    }

    public StudentInfo(double chineseScore, double mathScore, double chemicalScore, double musicScore) {

        this.chineseScore = chineseScore;
        this.mathScore = mathScore;
        this.chemicalScore = chemicalScore;
        this.musicScore = musicScore;

    }


    public double getScoreSum() {
        double sum = this.chineseScore + this.musicScore + this.chemicalScore + this.mathScore;
        return sum;
    }


    public double getAvgScore() {
        return getScoreSum() / 4;
    }

    public double getBestScore() {

        // 150分制
        double tmp1 = chineseScore > chemicalScore ? chineseScore : chemicalScore;

        // 100分制
        double tmp2 = mathScore > musicScore ? mathScore : musicScore;


        double best = tmp1 / 150 > tmp2 / 100 ?  tmp1 : tmp2;

        return best;

    }


}
